<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center masterList_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub masterList_fd0_0'>
					<view class='flex flex-wrap align-center masterList_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  masterList_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<text class='masterList_fd0_0_c1'>师傅列表</text>
					<view class='flex flex-wrap align-center justify-end masterList_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view
				class="flex flex-direction flex-wrap align-stretch justify-between benben-position-layout flex masterList_flex_1"
				:style="{top:(88+StatusBarRpx)+'rpx', }">
				<view>
					<benben-flex-tabs class-name='masterList_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='true' :top='0' :is-show-content='false' :scrollspy='false'
						:tabs-info.sync="tabsInfofd1_0" @change="getTechnicianFunc()">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<view
										:class="{ 'checkTitlefd1_0': tabs == '0', 'flex flex-wrap align-center': true }"
										@tap="tabs = '0'" :id="`benben_tabsfd1_0-title-item-${'0'}`">

										<text>全部</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '1', 'flex flex-wrap align-center': true }"
										@tap="tabs = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

										<text>审核中</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center': true }"
										@tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

										<text>审核成功</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '3', 'flex flex-wrap align-center': true }"
										@tap="tabs = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

										<text>审核失败</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line masterList_linefd1_0"></view>
							</view>
						</scroll-view>

					</benben-flex-tabs>

				</view>
				<view class='flex flex-wrap align-center masterList_fd1_1'>
					<view class='flex flex-wrap align-center flex-sub masterList_fd1_1_c0'>
						<image class='masterList_fd1_1_c0_c0' mode="aspectFit" :src='STATIC_URL+"33.png"'></image>
						<benben-input class='flex-sub masterList_fd1_1_c0_c1' type="text" :placeholder="`请输入关键字`"
							confirm-type="done" :maxlength="-1"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:24rpx"
							@confirm="getTechnicianFunc()" v-model="keyword" />
					</view>
				</view>

			</view>
			<view :style="{height: '170rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout masterList_flex_2">
				<template v-for='(item,key0) in technicianList'>
					<view class='flex flex-direction flex-wrap align-stretch masterList_fd2_0' @tap.stop="handleJumpDiy"
						data-type="navigateTo"
						:data-url="`/pages/order/addMasterWorker/addMasterWorker?id=${item.aid}&shopID=${shopID}`"
						:key='key0'>
						<view class='flex flex-wrap align-center justify-end masterList_fd2_0_c0'>
							<text class='masterList_fd2_0_c0_c0' v-if="item.status=='2'">审核成功</text>
							<text class='masterList_fd2_0_c0_c0'
								v-if="item.status=='1' && item.shop_status=='1'">店铺审核中</text>
							<text class='masterList_fd2_0_c0_c0'
								v-if="item.status=='1' && item.shop_status == '2'">平台审核中</text>
							<text class='masterList_fd2_0_c0_c0'
								v-if="item.status=='1' && item.shop_status=='3'">店铺审核失败</text>
							<text class='masterList_fd2_0_c0_c0' v-if="item.status=='3'">平台审核失败</text>
						</view>
						<view class='flex flex-wrap align-center masterList_fd2_0_c1'>
							<image class='masterList_fd2_0_c1_c0' mode="aspectFill" :src='item.avatar'></image>
							<view class='flex flex-direction flex-wrap align-stretch flex-sub masterList_fd2_0_c1_c1'>
								<text class='flex-sub masterList_fd2_0_c1_c1_c0'>{{item.name}}</text>
								<view class='flex flex-wrap align-center'>
									<template v-for="starNum in [1,2,3,4,5]">
										<image v-if="item.start_count >= starNum" :key="starNum"
											class='masterList_star1fd2_0_c1_c1_c1' mode="aspectFit"
											:src='STATIC_URL+"30.png"'></image>
										<image v-else :key="starNum" class='masterList_star1fd2_0_c1_c1_c1'
											mode="aspectFit" :src='STATIC_URL+"31.png"'></image>
									</template>
								</view>
							</view>
							<view class='flex flex-wrap align-center masterList_fd2_0_c1_c2'>
								<text class='masterList_fd2_0_c1_c2_c0'>已接</text>
								<text class='masterList_fd2_0_c1_c2_c0'>{{item.order_count}}</text>
								<text class='masterList_fd2_0_c1_c2_c0'>单</text>
							</view>
						</view>
						<view class='flex flex-wrap align-center justify-end serviceList_fd3_0_c2001'
							v-if="item.shop_status == '1'">
							<button class='serviceList_fd3_0_c2_c0001'
								@tap.stop="errExamineFunc(item.user_id,item.type)">审核失败</button>
							<button class='serviceList_fd3_0_c2_c0001'
								@tap.stop="successExamineFunc(item.user_id,item.type)">审核成功</button>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->
			<!---审核成功弹窗flex布局开始-->
			<benben-popup v-model="popupShow1677313288773" :mask="true" :mask-close-able="true" mode='center'>
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout set_flex_2">
					<text class='set_fd2_0'>提示</text>
					<text class='set_fd2_1'>确定审核成功吗？</text>
					<view class='flex flex-wrap align-center'>
						<button class='set_fd2_2_c0' @tap.stop="popupShow1677313288773=false">取消</button>
						<button class='set_fd2_2_c1' @tap.stop="postExamineFunc()">确认</button>
					</view>
				</view>
			</benben-popup>
			<!---审核成功弹窗flex布局结束-->
			<!---审核失败flex布局开始-->
			<benben-popup v-model="popupShow1717064495517" :mask="true" :mask-close-able="true" mode='center'>
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout serviceList_flex_4002">
					<text class='serviceList_fd4_0002'>拒绝原因</text>
					<view class='flex flex-wrap serviceList_fd4_1002'>
						<textarea class='flex serviceList_input_fd4_1002' :placeholder="'您输入审核失败原因'" :maxlength="240"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx" v-model="reason" />
					</view>
					<view class='flex flex-wrap align-center'>
						<button class='serviceList_fd4_2_c0002' @tap.stop="popupShow1717064495517=false">取消</button>
						<button class='serviceList_fd4_2_c1002' @tap.stop="postExamineFunc()">提交</button>
					</view>
				</view>
			</benben-popup>
			<!---审核失败flex布局结束-->
		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"popupShow1677313288773": false, //审核成功
				"popupShow1717064495517": false, //审核失败
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"forbidden_id": "",
				"tabs": "0",
				"shopID": uni.getStorageSync('shopID') || '',
				"keyword": "",
				"technicianList": [],
				"status": "",
				"status_id": "",
				"user_id": "",
				"type_id": "",
				"examine_id": "",
				"reason": "",
				"dataObj": {
					"aid": "",
					"name": ""
				}
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.shopID = uni.getStorageSync('shopID') || ''
			this.getTechnicianFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getTechnicianFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取师傅信息
			getTechnicianFunc() {
				this.minixPagingListsApi = global.apiUrls.post648287c17d189;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					status: this.tabs,
					keyword: this.keyword,
					usermerchant_id: this.shopID
				}
				this.listData = [];
				this.technicianList = this.listData;
				this.pagingListToggle();

			},
			//审核成功赋值
			successExamineFunc(userID, typeID) {
				this.user_id = userID;
				this.examine_id = '2';
				this.type_id = typeID;
				this.popupShow1677313288773 = true;
			},
			//审核失败赋值
			errExamineFunc(userIDS, typeIDS) {
				this.examine_id = '3';
				this.user_id = userIDS;
				this.type_id = typeIDS;
				this.popupShow1717064495517 = true;
			},
			//提交审核成功
			async postExamineFunc() {
				if (this.reason == '' && this.examine_id == '3') {
					this.$message.info('请输入拒绝原因');
					return false;
				}
				// return
				//请求方法
				//数据验证 
				console.log(this.type_id, '111111');
				console.log(this.examine_id, '222222');
				console.log(this.user_id, '33333');
				console.log(this.reason, '4444444');
				let data66584b61644e2 = await this.$api.dbPost(global.apiUrls.post66584b61644e2, {
					type: this.type_id,
					status: this.examine_id,
					aid: this.user_id,
					reason: this.reason
				});
				if (!data66584b61644e2) return
				if (data66584b61644e2.data.code != 1) {
					this.$message.info(data66584b61644e2.data.msg);
					return
				}
				let info66584b61644e2 = data66584b61644e2.data;
				if (this.examine_id == '2') {
					this.popupShow1677313288773 = false;
				} else {
					this.popupShow1717064495517 = false;
				}
				this.reason = ''
				this.getTechnicianFunc()
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.masterList_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.masterList_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.masterList_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.masterList_fd0_0_c0 {
		width: 200rpx;
		height: 88rpx;
	}

	.masterList_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.masterList_flex_1 {
		width: 750rpx;
		height: 170rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background: rgba(248, 248, 248, 1);
	}

	.masterList_fd1_1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.masterList_fd1_1_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.masterList_fd1_1_c0 {
		background: #fff;
		height: 64rpx;
		background-size: 100% auto !important;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 24rpx 0rpx 24rpx;
	}

	.masterList_fd1_1 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.masterList_linefd1_0 {
		background: #d53215;
		width: 32rpx;
		height: 10rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 0rpx 0rpx 16rpx 16rpx;
	}

	.checkTitlefd1_0 {
		font-weight: 700 !important;
		font-size: 28rpx !important;
		color: rgba(230, 0, 0, 1) !important;
		background-color: rgba(255, 255, 255, 0) !important;
	}

	::v-deep .masterList_benbenTabsfd1_0 {
		width: 750rpx;
		height: 88rpx;
		white-space: nowrap;
		text-align: center;
	}

	.masterList_flex_2 {
		padding: 24rpx 24rpx 0rpx 24rpx;
	}

	.masterList_fd2_0_c1_c2_c0 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.masterList_fd2_0_c1_c2 {
		margin: 13rpx 0rpx 0rpx 0rpx;
	}

	.masterList_star1fd2_0_c1_c1_c1 {
		margin: 0rpx 4rpx 0rpx 0rpx;
		height: 18rpx;
		width: 18rpx;
	}

	.masterList_star1fd2_0_c1_c1_c1 {
		width: 18rpx;
		height: 18rpx;
		margin: 0rpx 4rpx 0rpx 0rpx;
	}

	.masterList_fd2_0_c1_c1_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 0rpx 13rpx 0rpx;
	}

	.masterList_fd2_0_c1_c1 {
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.masterList_fd2_0_c1_c0 {
		width: 96rpx;
		height: 96rpx;
		border-radius: 48rpx 48rpx 48rpx 48rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.masterList_fd2_0_c1 {
		margin: 32rpx 0rpx 32rpx 0rpx;
	}

	.masterList_fd2_0_c0_c0 {
		font-size: 028rpx;
		font-weight: 400;
		color: #333;
		line-height: 40rpx;
	}

	.masterList_fd2_0_c0 {
		border-bottom: 1px solid #eee;
		padding: 24rpx 0rpx 24rpx 0rpx;
	}

	.masterList_fd2_0 {
		background: #fff;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.serviceList_fd3_0_c2_c0001 {
		border: 1px solid #eee;
		background: #fff;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		font-size: 24rpx;
		color: #333;
		padding: 0rpx 40rpx 0rpx 40rpx;
		height: 64rpx;
		line-height: 64rpx;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.serviceList_fd3_0_c2001 {
		border-top: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	//失败弹窗
	.serviceList_flex_4002 {
		background: #fff;
		width: 560rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.serviceList_fd4_0002 {
		line-height: 50rpx;
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		margin: 32rpx 0rpx 24rpx 0rpx;
		text-align: center;
	}

	.serviceList_fd4_1002 {
		background: rgba(246, 247, 249, 1);
		padding: 24rpx 24rpx 24rpx 24rpx;
		margin: 0rpx 32rpx 40rpx 32rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.serviceList_input_fd4_1002 {
		width: 100%;
		height: 246rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		white-space: pre-wrap;
	}

	.serviceList_fd4_2_c0002 {
		border-top: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		width: 278rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}

	.serviceList_fd4_2_c1002 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: rgba(238, 82, 90, 1);
		width: 278rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}

	//成功弹窗

	.set_flex_2 {
		background: #fff;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.set_fd2_0 {
		line-height: 50rpx;
		font-size: 36rpx;
		font-weight: 800;
		color: #333333;
		margin: 40rpx 0rpx 32rpx 0rpx;
		text-align: center;
	}

	.set_fd2_1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 0rpx 0rpx 37rpx 0rpx;
		text-align: center;
	}

	.set_fd2_2_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		width: 269rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}

	.set_fd2_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: rgba(227, 29, 26, 1);
		width: 269rpx;
		height: 94rpx;
		line-height: 94rpx;
		font-weight: 500;
	}
</style>